package com.wuyou.designPatterns.memento;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 记录状态的类
 * @Author 无忧
 * @Date 2024/10/16 21:36
 */
public class Memento {

    int money;
    ArrayList fruits;

    public int getMoney(){
        return this.money;
    }

    Memento(int money){
        this.money = money;
        fruits = new ArrayList();
    }

    void addFruit(String fruit){
        fruits.add(fruit);
    }

    List getFruits(){
        return (List) fruits.clone();
    }
}
